﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BusinessDecision.JobAdministrator.Web.UI.Common.UserControls
{
    public partial class Connect : System.Web.UI.UserControl
    {
        public string TargetControlID
        {
            get
            {
                return ModalPopupExtender1.TargetControlID;
            } 
            set
            {
                ModalPopupExtender1.TargetControlID = value;
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        protected void Cancel(object sender, EventArgs e)
        {
            ModalPopupExtender1.Hide();
        }

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            PopupHide += OnPopupHide;
        }

        protected virtual void OnPopupHide(object sender, EventArgs e)
        {
            ModalPopupExtender1.Hide();
        }

        public delegate void PopupHideEventHandler(object sender, EventArgs args);
        [Browsable(true)]
        [Localizable(true)]
        public event PopupHideEventHandler PopupHide;

        protected void Options(object sender, EventArgs e)
        {
            BtnOption.Text = BtnOption.Text.EndsWith(">>") ? "More Options <<" : "More Options >>";

            MainTab.Tabs[1].Visible = MainTab.Tabs[2].Visible = MainTab.Tabs[3].Visible = BtnOption.Text.EndsWith(">>");
        }
    }
}